package com.linked.mystyle.leaveword.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.linked.mystyle.leaveword.bean.LeaveWordReturnPO;
import com.linked.mystyle.leaveword.bean.ReturnWordRequest;
import com.linked.mystyle.leaveword.mapper.ILeaveWordReturnMapper;
import com.linked.mystyle.leaveword.service.ILeaveWordReturnService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author :dbq
 * @date : 2022/10/8 8:34
 */
@Service
public class LeaveWordReturnServiceImpl implements ILeaveWordReturnService {

    private final ILeaveWordReturnMapper leaveWordReturnMapper;

    @Autowired
    public LeaveWordReturnServiceImpl(ILeaveWordReturnMapper leaveWordReturnMapper) {
        this.leaveWordReturnMapper = leaveWordReturnMapper;
    }

    @Override
    public IPage<LeaveWordReturnPO> queryReturnWordList(ReturnWordRequest request) throws Exception {
        return leaveWordReturnMapper.queryReturnWordList(request);
    }

    @Override
    public boolean deleteLeaveWordReturn(LeaveWordReturnPO param) throws Exception {
        return leaveWordReturnMapper.deleteById(param.getLeavewordReturnId()) > 0;
    }
}
